﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache" content="no-cache" />
    <title></title>
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/ligerui-icons.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Gray/css/all.css" />
    <link rel="stylesheet" href="~/Content/css/common.css" />
    <script src="~/Scripts/jquery-1.10.2.min.js"  ></script>
    <script src="~/Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
    <style  >
    .datouwang-container{padding:0 10px 10px 5px;}
    .photos{margin:auto;}
    .photo{position:relative;display:none;margin-top:10px!important;}
    .content{width:110px!important;height:85px!important;}
    .jiantou{display:none;margin-bottom:10px;width:30px!important;}
    .title{position:absolute;padding:10px;width:90px;color:#979797;text-align:center;font-weight:700;font-size:12px;}
    .light{color:#000;}
    </style>
</head>
<body>
    <div class="searchbar">
        <div class="sblabel"><font style="font-weight: bold" id="name"></font></div>
        <div class="sblabel"><font style="font-weight: bold" id="age"></font></div>
        <div class="sblabel"><font style="font-weight: bold" id="sex"></font></div>
        <div class="sblabel"><font style="font-weight: bold" id="dis"></font></div>
    </div>
    <div class="datouwang-container" id="content">
    </div>
    <!--定义模板-->
    <script src="~/Areas/ChestPainCenter/Scripts/artTemplate.js"></script>
    <script id="test" type="text/html">
        <div class="photos" style="margin-left: 35px">
            {{each TimeLine as value i}}
            <div>
                {{if value.OverTimeBool}}
                <div style="float:left;border-radius: 8px;border:2px solid #CD0000;margin-right: 35px ;margin-top: 10px;">
                    {{else}}
                    {{if value.Time==""}}
                    <div style="float:left;border-radius: 8px;border:2px solid #8C8C8C;margin-right: 35px ;margin-top: 10px;">
                        {{else}}
                        <div style="float:left;border-radius: 8px;border:2px solid #1bad23;margin-right: 35px ;margin-top: 10px;">
                            {{/if}}
                            {{/if}}
                            {{if i==0}}
                            <img src="/Content/images/square.png" class="content">
                            <div style="position: absolute;margin-top:-60px;width:110px;height:30px;">
                                <p>{{value.Title}}</p>
                                <hr style="height:1px;border:none;border-top:1px dashed #0066CC;" />
                                <p class="time">{{value.Time}}</p>
                            </div>
                            {{else}}
                            <img src="/Content/images/square.png" class="content">
                            <div style="position: absolute;margin-top:-60px;width:110px;height:30px;">
                                <p>{{value.Title}}</p>
                                <hr style="height:1px;border:none;border-top:1px dashed #0066CC;" />
                                <p class="time">{{value.Time}}</p>
                            </div>
                            <img style="margin-left: -150px" src="/Content/images/jiantou.png">
                            {{/if}}
                        </div>
                    </div>
                    {{/each}}
                </div>
            </div>
        </div>
    </script>
    <script src="~/Scripts/jquery.xgallerify.min.js"></script>
    <script  >
        var gallery = $('.photos').gallerify({
            margin: 5,
            mode: 'default',
            lastRow: 'adjust'
        });
        $(function () {
            $("#txtInDate").ligerDateEditor({
                showTime: false,
                format: "yyyy-MM-dd",
                width: 110,
                cancelable: false
            });
        });
        $.ajax({
            url: "/ChestPainCenter/Pathway/Action?Pid=" + getQueryStringByName("id"),
            cache: false,
            success: function (data) {
                if (typeof (data.PatientInfo) == "undefined" || data.PatientInfo == null) return;
                $('#name').text("姓名：" + data.PatientInfo.Name);
                $('#age').text("年龄：" + data.PatientInfo.Age);
                $('#sex').text("性别：" + data.PatientInfo.Sex);
                $('#dis').text("诊断：" + data.PatientInfo.PRE_DIAGNOSIS);
                var html = template('test', data);
                //找到并替换
                document.getElementById('content').innerHTML = html;
                FormatDateTime();
            }
        })
        //根据QueryString参数名称获取值
        function getQueryStringByName(name) {
            var result = location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
            if (result == null || result.length < 1) {
                return "";
            }
            return unescape(result[1]);
        }
        function FormatDateTime() {
            $(".time").each(function () {
                var time = $(this).text();
                $(this).text(obj2Timemm(time));
            })
        }
    </script>
</body>
</html>